package com.whfc.fmam.config;

import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySource;
import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySources;
import com.whfc.common.file.FilePathConfig;
import com.whfc.common.spring.AppContextUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description:
 * @author: xugcheng
 * @version: 1.0
 * @date: 2021-10-12 11:12
 */
@Configuration
@NacosPropertySources(value = {
        @NacosPropertySource(dataId = "com.whfc.common.properties", autoRefreshed = true)
})
public class FmamSyncConfig {

    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @Value("${spring.profiles.active}")
    private String profile;

    @Bean
    public FilePathConfig filePathConfig() {
        return new FilePathConfig("ms", profile);
    }

    @Bean
    public AppContextUtil getAppContextUtil() {
        return new AppContextUtil();
    }
}
